// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import Vuex from 'vuex'
// 1.引入样式 vue文件中style可重写样式 打包后生效
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import waterfall from 'vue-waterfall2'
// 按需引入 iview 组件
import { Message, Select, Option, List, ListItem, Tag, Icon,
  Dropdown, DropdownItem, DropdownMenu, Modal, Tabs, TabPane, Time,
  Layout, Sider, Content, Footer, Header, Menu, MenuItem, Row, Col, Divider } from 'view-design'
import 'view-design/dist/styles/iview.css'
// 2.引入app等必须
import App from './App'
import router from './router'
// 3.引入其他必须
import VueAxios from 'vue-axios'
import axios from 'axios'
import VueWechatTitle from 'vue-wechat-title'
// 4.引入自定义js
import lseajax from './util/api'
import lseutil from './util/util'
import lsedata from './util/data'
import qs from 'qs'
import store from './store/index'
import lsews from './util/ws'

Vue.prototype.qs = qs
Vue.prototype.lseajax = lseajax
Vue.prototype.lseutil = lseutil
Vue.prototype.lsedata = lsedata
Vue.prototype.lsews = lsews

// 按需引入 iview 组件
Vue.prototype.$Message = Message
Vue.prototype.$Modal = Modal
Vue.component('Select', Select)
Vue.component('Option', Option)
Vue.component('List', List)
Vue.component('ListItem', ListItem)
Vue.component('Tag', Tag)
Vue.component('Icon', Icon)
Vue.component('Dropdown', Dropdown)
Vue.component('DropdownItem', DropdownItem)
Vue.component('DropdownMenu', DropdownMenu)
Vue.component('Tabs', Tabs)
Vue.component('TabPane', TabPane)
Vue.component('Modal', Modal)
Vue.component('Time', Time)
Vue.component('Layout', Layout)
Vue.component('Sider', Sider)
Vue.component('Content', Content)
Vue.component('Footer', Footer)
Vue.component('Header', Header)
Vue.component('Menu', Menu)
Vue.component('MenuItem', MenuItem)
Vue.component('Row', Row)
Vue.component('Col', Col)
Vue.component('Divider', Divider)

Vue.use(Vuex)
Vue.use(ElementUI)
Vue.use(waterfall)
Vue.use(VueWechatTitle)
Vue.use(VueAxios, axios)

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
